/* Mohamed Zaid Bhura
 * CSE 2102
 * Lab 1
 * This is the ButtonPanel class which will hold all of the ColorRadioButtons.
 */

import javax.swing.*;
import java.awt.Color;

public class ButtonPanel extends JPanel {
	private Color _color = Color.GRAY;

	public ButtonPanel(DemoPanel aPanel) {
		super(new java.awt.GridLayout(0, 1)); // Creates a new GridLayout with 0
												// columns and 1 row.
		ButtonGroup group = new ButtonGroup(); // Creates a new button group.
		ColorRadioButton redButton = new ColorRadioButton(Color.RED, "RED",
				group, true, aPanel);
		ColorRadioButton blueButton = new ColorRadioButton(Color.BLUE, "BLUE",
				group, false, aPanel);
		ColorRadioButton greenButton = new ColorRadioButton(Color.GREEN,
				"GREEN", group, false, aPanel);
		ColorRadioButton orangeButton = new ColorRadioButton(Color.ORANGE,
				"ORANGE", group, false, aPanel);
		ColorRadioButton yellowButton = new ColorRadioButton(Color.YELLOW,
				"YELLOW", group, false, aPanel);
		ColorRadioButton cyanButton = new ColorRadioButton(Color.CYAN, "CYAN",
				group, false, aPanel);
		ColorRadioButton magentaButton = new ColorRadioButton(Color.MAGENTA,
				"MAGENTA", group, false, aPanel);
		ColorRadioButton pinkButton = new ColorRadioButton(Color.PINK, "PINK",
				group, false, aPanel);
		ColorRadioButton whiteButton = new ColorRadioButton(Color.WHITE,
				"WHITE", group, false, aPanel);
		CustomRadioButton customButton = new CustomRadioButton(_color, "CUSTOM", group, false, aPanel);
		JPanel radioRow = new JPanel(); // Creates a new radioRow panel.
		radioRow.add(redButton);
		radioRow.add(blueButton);
		radioRow.add(greenButton);
		radioRow.add(orangeButton);
		radioRow.add(yellowButton);
		radioRow.add(cyanButton);
		radioRow.add(magentaButton);
		radioRow.add(pinkButton);
		radioRow.add(whiteButton);
		radioRow.add(customButton);
		this.add(radioRow); // Adds the radioRow to the ButtonPanel.
	}
}
